package com.whcoding.test.example.imgconvert;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.util.ArrayList;
import java.util.List;

public class ImgConvertFont {

    /**
     * 将图片转为字体
     * @param args
     */
    public static void main(String[] args) {
        Tess4jClient tess4jClient2=new Tess4jClient();
        List<String> images=new ArrayList<>(16);

        try {
            for (String image : images) {
                //将文件转为字节
                byte[] bytes =null;
//                        fileService.downLoadFile(image);
                //从byte[]转换为butteredImage
                ByteArrayInputStream in = new ByteArrayInputStream(bytes);
                BufferedImage imageFile = ImageIO.read(in);
                //识别图片的文字
                String result = tess4jClient2.doOCR(imageFile);
            }
        }catch (Exception e){
            e.printStackTrace();
        }

    }
}
